<?php
include("db/connect.php");
$sqlselectupdate="select * from material where mat_id='".$_POST["temp"]."'";
$queryselectupdate=mysql_query($sqlselectupdate);
$fetchselectupdate=mysql_fetch_array($queryselectupdate);
?>
<form id="fromInsert_Mat" name="fromInsert_Mat" method="post" action="Javascript:ajaxmanage(3,<?php echo $_POST["temp"]?>);">
  <table width="528" border="0">
    <tr>
      <td width="178">รหัสสินค้า</td>
      <td width="340"><input type="text" name="mat_id" id="mat_id" readonly value="<?php echo $fetchselectupdate["mat_id"]?>"/></td>
    </tr>
    <tr>
      <td>ชื่อสินค้า</td>
      <td><input name="mat_name" type="text" id="mat_name" value="<?php echo $fetchselectupdate["mat_name"]?>" /></td>
    </tr>
    <tr>
      <td>ราคา</td>
      <td><input name="mat_price" type="text" id="mat_price" value="<?php echo $fetchselectupdate["mat_price"]?>" /></td>
    </tr>
    <tr>
      <td>หน่วย</td>
      <td><input name="mat_unit" type="text" id="mat_unit" value="<?php echo $fetchselectupdate["mat_unit"]?>" /></td>
    </tr>
    </table>
  <p align="center">
    <input type="submit" name="Submit" id="button" value="Submit" />
    <input type="reset" name="button2" id="button2" value="Reset" />
  </p>
  <p>&nbsp;</p>
</form>
<script>
	function submitCus(){
	$.ajax({
			type:"POST",
			url:"insert_material2.php",
			data:$("#fromInsert_Cus").serialize(),
			success: function(msg){
				$("#spantest").html(msg);
				}
			});//ajax
	}
	
</script>
